#include "stdafx.h"
#include <cstdio>
#include <fstream>
#include <stdexcept>
#include <locale>
namespace Utility {
    std::string read_from_file(const char* file_name) {
        std::locale loc = std::locale::global(std::locale(".936")) ;
        std::ifstream instream(file_name) ;
        if(!instream.is_open()) {
            std::locale::global(loc) ;
            throw std::runtime_error("could not open file") ;
        }
        instream.unsetf(std::ios::skipws) ;
        std::string return_info(std::istreambuf_iterator<char>(instream.rdbuf()),
                                std::istreambuf_iterator<char>()) ;
        std::locale::global(loc) ;
        return return_info ;
    }
}
